package com.zzzyh.blogbyspring.advice;

import com.zzzyh.blogbyspring.pojo.Response;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ErrorAdvice {
    @ExceptionHandler
    public Response error(Exception e) {
        return Response.fail(e.getMessage());
    }
}
